module tcs {
	export class scrolpanel extends egret.DisplayObjectContainer{
		private bootom:egret.Shape;
		private top1:egret.Shape;
		private scrol1:egret.TextField;
		private scrol:number=0;
	    private btn:egret.TextField;
		private restart1:tcs.index;
		public constructor() {
		 super();
		 this.restart1=new tcs.index();
		 this.top1=new egret.Shape();
		 this.bootom=new egret.Shape();
		 this.scrol1=new egret.TextField();
		 this.btn=new egret.TextField();
		 //this.createchild();
	  }
	  private createchild(){
            this.drawbootom();
			this.drawtop1();
			this.scrol1.width=1130;
			this.scrol1.y=200;
			this.scrol1.size=20;
			this.scrol1.textAlign="center";
			this.scrol1.textColor=0x000000;
			this.scrol1.text="得分为："+this.scrol;
			this.addChild(this.scrol1);
            this.btn.width=1130;
			this.btn.y=250;
			this.btn.size=20;
			this.btn.textColor=0x000000;
			this.btn.text="再来一次"
			this.btn.textAlign="center";
			this.btn.touchEnabled=true;
			this.addChild(this.btn);
			this.btn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.restart,this);
			

	  }
	  private drawbootom(){
		  this.bootom.graphics.beginFill(0xffffff,1);
		  this.bootom.graphics.drawRect(0,0,1130,640);
		  this.bootom.graphics.endFill();
		  this.addChild(this.bootom);
	  }
	  private drawtop1(){
		  this.top1.graphics.beginFill(0x1c6ff8,1);
		  this.top1.graphics.drawRect(0,0,1130,100);
		  this.top1.graphics.endFill();
		  this.addChild(this.top1);
	  }
	  private restart(){
		  this.removeChild(this.btn);
		   this.removeChild(this.bootom);
		    this.removeChild(this.top1);
			 this.removeChild(this.scrol1);
         this.addChild(this.restart1);
	  }
	  public printscrolpanel(a:number){
          this.scrol=a;
		  this.createchild();
	  }
	}
}